package com.ruoyi.project.shortUrl.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.ruoyi.project.shortUrl.url.domain.ShortUrl;
import com.ruoyi.project.shortUrl.url.service.IShortUrlService;

@Component
public class CheckShortCode {
	
	@Autowired
	private IShortUrlService shortUrlService;
	
	/**
	 * 短号是否唯一
	 * @param shortCode
	 * @return
	 */
	public ShortUrl shortCodeIsUnique(String shortCode) {
		ShortUrl exist = shortUrlService.selectShortUrlById(shortCode);
		return exist;
	}
	
}
